import { configureStore } from '@reduxjs/toolkit'
import { rootReducer } from './reducers/rootReducer'
import { userApiSlice } from '../api/userApiSlice'
import { productsApiSlice } from '../api/productsApiSlice'

const store = configureStore({
	reducer: rootReducer,
	middleware: (getDefaultMiddleware) =>
		getDefaultMiddleware().concat([
			userApiSlice.middleware,
			productsApiSlice.middleware,
		]),
	devTools: process.env.NODE_ENV !== 'production',
})

export default store
